package com.seu.me.test;

import lombok.extern.slf4j.Slf4j;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Created by liangfeihu on 2018/1/6.
 */
@Slf4j
public class MyTest1 {
    public static void main(String[] args) throws Exception {
        /*String bill_date = "2018-01-06T00:00:00.000+08";
        String payment_due_date = "2018-01-25T00:00:00.000+08";

        String trans_date = "2017-12-16T00:00:00.000+08";

        System.out.println("bill_date=" + new DateTime(bill_date).toString("yyyy-MM-dd HH:mm:ss"));
        System.out.println("payment_due_date=" + new DateTime(payment_due_date).toString("yyyy-MM-dd HH:mm:ss"));
        System.out.println("trans_date=" + new DateTime(trans_date).toString("yyyy-MM-dd HH:mm:ss"));

        System.out.println("trans_date2=" + dealDateFormat(trans_date));*/

        /*int length = 7;
        DateTime time = new DateTime(new Date());
        while(length > 0){
            length --;
            String dateStr = time.plusDays(-length).toString("yyyy-MM-dd");
            System.out.println(dateStr);
        }

        LocalDate localDate = new LocalDate();
        for (int i = length -1; i >= 0; i--) {
            System.out.println(localDate.minusDays(i).toDate());
        }*/

        Long platformId = 700L;
        if (platformId.longValue() < 729) {
            System.out.println(platformId + "是信用卡平台ID");
        }
        log.info("{} {} {} {} {}", 1, 2, 3, 4, 5);

    }

    /**
     * 日期格式转换yyyy-MM-dd'T'HH:mm:ss.SSSXXX  (yyyy-MM-dd'T'HH:mm:ss.SSSZ) TO  yyyy-MM-dd HH:mm:ss
     *
     * @throws ParseException
     */
    public static String dealDateFormat(String oldDateStr) throws ParseException {
        //此格式只有  jdk 1.7才支持  yyyy-MM-dd'T'HH:mm:ss.SSSXXX
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");  //yyyy-MM-dd'T'HH:mm:ss.SSSZ
        Date date = df.parse(oldDateStr);
        SimpleDateFormat df1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK);
        Date date1 = df1.parse(date.toString());
        DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //  Date date3 =  df2.parse(date1.toString());
        return df2.format(date1);
    }

}
